package api.notifitbx;

import android.content.Context;

import java.lang.ref.SoftReference;

/**
 * Created by wilbur on 2017/12/26.
 */

public abstract class Router_Notifitbx {

    public static String clazz = "com.dt.idobox.api.Notifi_API";

    private static SoftReference<Router_Notifitbx> sf;

    public abstract void initPlatform(Context ctx);
    public abstract void showINotification(Context ctx);
    public abstract void wakeNotification(Context ctx);
    public abstract void boxVCode(int code);
    public abstract void isHaveWeekDayNotifi(boolean flag);
    public abstract void isHaveNotification(boolean flag);
    public abstract void isGPVersion(boolean flag);
    public abstract void isTestServer(boolean flag);

    public synchronized static Router_Notifitbx getInstance(){
        if(sf==null || sf.get()==null){
            Object o = null;
            try {
                o = Class.forName(clazz).newInstance();
            }catch (Exception ex){
                ex.printStackTrace();
            }
            if(o!=null){
                sf = new SoftReference<Router_Notifitbx>((Router_Notifitbx)o);
                return (Router_Notifitbx)o;
            }
        }
        return sf == null ? null : sf.get();
    }
}
